{template paome_header}
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<style type="text/css">
    .bg{display:none;position:fixed;width:100%;height:100%;background:#000;z-index:2;top:0;left:0;opacity:0.7;}
</style>
<h4 style="padding-left:10px;;">
    <a href="?c=paome_index&a=getPaomeList"><span>赛季列表</span></a>
    >>
    <span>俱乐部列表</span>
</h4>
<form class="form-horizontal" method="POST" action="?c=paome_club&a=getClubList&paomeId={$paomeId}"  >
    <div class="control-group search-group">
        <label class="control-label" >俱乐部：</label>
        <div class="controls">
            <input type="text" value="{$name}" name="name" placeholder="俱乐部名称" />
        </div>
    </div>

    <div class="control-group search-group">
        <label class="control-label" >状态：</label>
        <div class="controls">
            <select name="status" id="status">
                <option value="0">全部</option>
                <option value="1" {if $status == 1 } selected {/if}>正常</option>
                <option value="5" {if $status == 5 } selected {/if}>解散</option>
            </select>
        </div>
    </div>

    <div class="control-group search-group">
        <label class="control-label" >赛季阶段：</label>
        <div class="controls">
            <select name="contestStatus" id="contestStatus">
                <option value="0">全部</option>
                {loop $arrStatus $k $v}
                    <optgroup label="{$v['name']}">
                        {loop $v['child'] $k2 $v2}
                            <option value="{$v2['id']}" {if $contestStatus == $v2['id']}selected{/if} >{$v2['name']}</option>
                        {/loop}
                    </optgroup>
                {/loop}
            </select>
        </div>
    </div>

    <div class="control-group search-group">
        <label class="control-label" >竞赛状态：</label>
        <div class="controls">
            <select name="contestStatus2" id="contestStatus2">
                <option value="0">全部</option>
                <option value="1" {if $contestStatus2 == 1}selected{/if} >竞赛中</option>
                <option value="2" {if $contestStatus2 == 2}selected{/if} >招募中</option>
                <option value="3" {if $contestStatus2 == 3}selected{/if} >已淘汰</option>
                <option value="4" {if $contestStatus2 == 4}selected{/if} >已结束</option>
            </select>
        </div>
    </div>

    <div class="control-group search-group">
        <label class="control-label" >赛绩：</label>
        <div class="controls">
            <select name="contestStatus3" id="contestStatus3">
                <option value="0">全部</option>
                <option value="1" {if $contestStatus3 == 1}selected{/if} >跑量榜由高到底</option>
                <option value="2" {if $contestStatus3 == 2}selected{/if} >配速榜由高到底</option>
                <option value="3" {if $contestStatus3 == 3}selected{/if} >人气榜由高到低</option>
            </select>
        </div>
    </div>

    <div class="control-group search-group">
        <label class="control-label" >人数：</label>
        <div class="controls">
            <select name="userNumType" id="userNumType">
                <option value="0">全部</option>
                <option value="1" {if $userNumType == 1}selected{/if} >人数由高到底</option>
                <option value="2" {if $userNumType == 2}selected{/if} >人数由低到高</option>
            </select>
            <input class="btn" type="submit" value="查询" />
        </div>
    </div>
</form>

<div class="bs-docs-example table-align pt-15" style="clear:both;">
    <table class="table table-striped table-align">
        <thead>
        <tr>
            <th>俱乐部ID</th>
            <th>俱乐部昵称</th>
            <th>俱乐部logo</th>
            <th>运行状态</th>
            <th>截止赛事阶段</th>
            <th>竞赛状态</th>
            <th>当前成员数量</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        {if count($list)>0}
        <tbody>
        {loop $list $k $v}
            <tr>
                <td>{$v['id']}</td>
                <td>{$v['title']}</td>
                <td><img src="{$v['image']}" style="width: 50px;height: 50px;" /></td>
                <td>{$v['statusMsg']}</td>
                <td>{$v['typeMsg']}</td>
                <td>{$v['typeStatusMsg']}</td>
                <td>{$v['user_num']}</td>
                <td>{$v['formatTime']}</td>
                <td>
                    {if $v['status'] == 0}
                        <a href="?c=paome_hall&a=hallClubRecommend&clubId={$v['id']}&optype=1">推荐</a>
                    {/if}
                    <a href="?c=paome_club&a=getClubDetail&paomeId={$paomeId}&clubId={$v['id']}">详情</a>
                </td>
            </tr>

        {/loop}
        <div id="res"></div>
        </tbody>
        {/if}
    </table>

</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
{template footer}
<div class="bg" id="bgx"></div>
<div id="dialog" style="position: absolute; z-index: 1003;background-color:white; display: none;" >
    <div  style="margin:50px 100px;">
        <div class="controls">
            <div style="padding-left:20px;">确定操作？</div><br />
            <div style="text-align: center">
               <button class="btn btn-primary" id="ok" ids="">确定</button>
               <button class="btn btn-primary" id="close" >取消</button>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $("a[id^='delLog_']").on('click',function () {
        var _this = $(this), _ids = _this.attr('ids');
        $("#bgx").show();
        letDivCenter('#dialog');
        $('#ok').attr({ids:_ids, action:'?c=adminFlashBuy&a=ajaxDelFlashBuy'});
    })

    $("a[id^='overLog_']").on('click',function () {
        var _this = $(this), _ids = _this.attr('ids');
        $("#bgx").show();
        letDivCenter('#dialog');
        $('#ok').attr({ids:_ids, action:'?c=adminFlashBuy&a=ajaxOverFlashBuy'});
    })
    $('#ok').on('click',function(){
        var _this = $(this),ids=_this.attr('ids'), action=_this.attr('action');
        $.ajax({
            type:'POST',
            url:action,
            data:{flashId:ids,status:status},
            dataType:'json',
            success:function(d){
                if(d.status=='ok'){
                    alert(d.error_msg);
                    window.location.reload();
                }else{
                    $('#close').click();
                    alert(d.error_msg);
                }
            }
        })
    })
    $('#close').on('click',function(){
        $('#dialog').css('display','none');
        $("#bgx").fadeOut(300);
    })
    function letDivCenter(divName){
        var divObj = $(divName);
        var wWidth = $(document.body).width(),wHeight = $(window).height();
        var divWidth = divObj.width(),divHeight = divObj.height();
        divObj.css({'left':(wWidth-divWidth)/2+$(window).scrollLeft(),'top':(wHeight-divHeight)/2+$(window).scrollTop(),'display':'block'});
        $(window).bind('scroll resize',function(){
            $(divName).css({'left':(wWidth-divWidth)/2+$(window).scrollLeft(),'top':(wHeight-divHeight)/2+$(window).scrollTop()});
        });
    }

</script>